package ils.services;

import ils.domain.model.User;
import ils.domain.model.UserRepository;
import ils.util.HibernateSession;
import ils.util.HibernateSessionManager;

import java.util.List;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * User: rejeevd
 * Date: 28/10/12
 * Time: 10:31 PM
 * To change this template use File | Settings | File Templates.
 */
public class MasterDataServiceImpl implements MasterDataService
{
    private HibernateSessionManager hibernateSessionManager;
    private UserRepository userRepository;

    @Override
    public Map<Integer, User> getUserDetails(List<Integer> userIds) {
        try(HibernateSession session = hibernateSessionManager.getSession())
        {
            return userRepository.getUsers(userIds);
        }
    }

    public void setHibernateSessionManager(HibernateSessionManager hibernateSessionManager) {
        this.hibernateSessionManager = hibernateSessionManager;
    }

    public void setUserRepository(UserRepository userRepository) {
        this.userRepository = userRepository;
    }
}
